package o;

import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.Log;
import androidx.annotation.AnimatorRes;
import androidx.annotation.Nullable;
import androidx.annotation.StyleableRes;
import java.util.ArrayList;
import java.util.List;

public class aqz {
    private final dy<String, aqw> ॱ = new dy();

    public boolean ॱ(String str) {
        return this.ॱ.get(str) != null;
    }

    public aqw ˏ(String str) {
        if (ॱ(str)) {
            return (aqw) this.ॱ.get(str);
        }
        throw new IllegalArgumentException();
    }

    public void ˊ(String str, @Nullable aqw o_aqw) {
        this.ॱ.put(str, o_aqw);
    }

    public long ˎ() {
        long j = 0;
        int size = this.ॱ.size();
        for (int i = 0; i < size; i++) {
            aqw o_aqw = (aqw) this.ॱ.ˋ(i);
            j = Math.max(j, o_aqw.ˋ() + o_aqw.ˎ());
        }
        return j;
    }

    @Nullable
    public static aqz ॱ(Context context, TypedArray typedArray, @StyleableRes int i) {
        if (typedArray.hasValue(i)) {
            int resourceId = typedArray.getResourceId(i, 0);
            if (resourceId != 0) {
                return ˏ(context, resourceId);
            }
        }
        return null;
    }

    @Nullable
    public static aqz ˏ(Context context, @AnimatorRes int i) {
        try {
            Animator loadAnimator = AnimatorInflater.loadAnimator(context, i);
            if (loadAnimator instanceof AnimatorSet) {
                return ˊ(((AnimatorSet) loadAnimator).getChildAnimations());
            }
            if (loadAnimator == null) {
                return null;
            }
            List arrayList = new ArrayList();
            arrayList.add(loadAnimator);
            return ˊ(arrayList);
        } catch (Throwable e) {
            Log.w("MotionSpec", "Can't load animation resource ID #0x" + Integer.toHexString(i), e);
            return null;
        }
    }

    private static aqz ˊ(List<Animator> list) {
        aqz o_aqz = new aqz();
        int size = list.size();
        for (int i = 0; i < size; i++) {
            ˊ(o_aqz, (Animator) list.get(i));
        }
        return o_aqz;
    }

    private static void ˊ(aqz o_aqz, Animator animator) {
        if (animator instanceof ObjectAnimator) {
            ObjectAnimator objectAnimator = (ObjectAnimator) animator;
            o_aqz.ˊ(objectAnimator.getPropertyName(), aqw.ˋ(objectAnimator));
            return;
        }
        throw new IllegalArgumentException("Animator must be an ObjectAnimator: " + animator);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        return this.ॱ.equals(((aqz) obj).ॱ);
    }

    public int hashCode() {
        return this.ॱ.hashCode();
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append('\n');
        stringBuilder.append(getClass().getName());
        stringBuilder.append('{');
        stringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
        stringBuilder.append(" timings: ");
        stringBuilder.append(this.ॱ);
        stringBuilder.append("}\n");
        return stringBuilder.toString();
    }
}
